<template>
  <div class="explanation mb-10">
    <div class="bckopa-tips">
      <div class="titleTips" @click="showTips=!showTips"  :class="showTips?'mb-10':''">
        <i class="iconfont iconcaozuo"></i>
        <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
      </div>
      <ul v-if="showTips">
        <li v-for="(item,index) in list" :key="index">
          <span v-if="item.type==0">{{item.text}}</span>
          <strong style="color:red" v-else-if="item.type==2">{{item.text}}</strong>
          <strong style="color:green" v-else>{{item.text}}</strong>
        </li>
      </ul>
    </div>
    <span title="收起提示" id="explanationZoom" style="display: block;"></span>
  </div>
</template>
<script>
import tipsJson from "./tips.js"

export default {
  name: "tips",
  props: ["optionTemplate"],
  components: {
  },
  data() {
    return {
      list:[],
      showTips:true
    };
  },
  created() {
    this.list = tipsJson.data[this.optionTemplate]
  },
  mounted() {
  },
  methods: {}
};
</script>
<style >
.explanation {
  width: 100%;
  background-color: #f3f4f4;
  padding: 0 18px 14px 18px;
  overflow: hidden;
  position: relative;
  border-radius: 5px;
}

.bckopa-tips {
  width: 90%;
  float: left;
}

.explanation .titleTips {
  white-space: nowrap;
  position: relative;
  cursor: pointer;
  margin-top: 8px;
  color: #148eff;
  cursor: pointer;
}

.explanation .titleTips i {
  margin-right: 5px;
  font-size: 22px;
}

.explanation .titleTips h4 {
  font-size: 14px;
  font-weight: normal;
  line-height: 20px;
  height: 20px;
  display: inline-block;

}

.explanation li {
  line-height: 20px;
  padding-left: 25px;
  padding-right: 30px;
  margin-bottom: 6px;
  position: relative;
  color: #555;
  font-size: 12px;
}

.explanation li::before {
  content: "";
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-left-color: transparent;
  border-left-style: solid;
  border-left-width: 4px;
  border-left: 6px solid #148eff;
  position: absolute;
  left: 6px;
  top: 6px;
}
</style>
